<div id='individuals-list'>
<span style="float:left;">
	<h1>Listing all details for what <% if @type.to_s == "1"%>you owe others<% else %>others owe you<% end %></h1>
</span>
<span style="float:right; margin-top: 20px;">
	<%= link_to image_tag('../images/silk/arrow_left.png', :class=>'icon') + ' Back', url_for(:back), :class=> 'icon-link' %>
</span>
<div class='clear'></div>
<table class="data-table">
	<thead>
		<tr>
			<th>Date Created</th>
			<th>Payer (to pay)</th>
			<th>Payee (to be paid)</th>
			<th>Expense</th>
			<th>Amount</th>
			<th>Paid?</th>
		</tr>
	</thead>
	<tbody>
		<% for e in @list %>
			<tr>
			<td><%=h format_date(e.created_at) %></td>
			<td><% if e.payer == current_user.id %>You<% else %><%=h User.find(e.payer).name %><% end %></td>
			<td><% if e.payee == current_user.id %>You<% else %><%=h User.find(e.payee).name %><% end %></td>
			<td><% if e.expense %><%= link_to h(e.expense.name), e.expense %><% else %>Consolidation<% end %></td>
			<td><%=h e.amount %></td>
			<td><% if e.paid %><%= image_tag('../images/silk/accept.png', :class=>'icon') %><% else %><%= link_to image_tag('../images/silk/money.png', :class=>'icon') + 'Mark as Paid', :action=>:mark_paid,:id=>e%><% end %></td>
			</tr>
		<% end %>
	</tbody>
</table>

</div>